<html xmlns="http://www.w3.org/1999/xhtml">

	<head>
		<link rel="shortcut icon" href="./images/icon.png" type="image/x-icon" />
		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
		<meta charset="utf-8">
		<meta http-equiv="X-UA-Compatible" content="IE=edge">
		<meta name="viewport" content="width=device-width,initial-scale=1">
		<link rel="stylesheet" href="css/iconfont/iconfont.css">
		<link rel="stylesheet" href="css/easyui/easyui.css">
		<link rel="stylesheet" href="css/easyui/icon.css">
		<link rel="stylesheet" href="css/css.css">
		<link rel="stylesheet" href="css/site.css">
		<link rel="stylesheet" href="./css/login/css/page/login.css">
		<link rel="shortcut icon" href="./images/myicon.png" type="image/x-icon" />
		<script src="js/common/jQuery.js"></script>
		<script src="js/common/jquery.easyui.min.js"></script>
		<script src="js/common/app.js"></script>
		<script src="js/common/common.js"></script>
		<script src="js/common/slidebar.js"></script>
		<title>系统登录</title>

		<script>
			$(function() {
				$(".screenbg ul li").each(function() {
					$(this).css("opacity", "0");
				});
				$(".screenbg ul li:first").css("opacity", "1");
				var index = 0;
				var t;
				var li = $(".screenbg ul li");
				var number = li.size();

				function change(index) {
					li.css("visibility", "visible");
					li.eq(index).siblings().animate({
						opacity: 0
					}, 3000);
					li.eq(index).animate({
						opacity: 1
					}, 3000);
				}

				function show() {
					index = index + 1;
					if(index <= number - 1) {
						change(index);
					} else {
						index = 0;
						change(index);
					}
				}
				t = setInterval(show, 8000);
				//根据窗口宽度生成图片宽度  
				var width = $(window).width();
				$(".screenbg ul img").css("width", width + "px");
			});
		</script>
	</head>

	<body>
		<div class="login-box">
			<div class="logo"><img src="./css/login/images/login/logo.png" ></div>
			<h1>东明后勤管理系统</h1>
			<div class="name">
				<label>管理员账号：</label>
				<input id="username" type="text" autocomplete="off" tabindex="1" name="">
			</div>

			<div class="password">
				<label>密 码：</label>
				<input id="pwd" type="password" tabindex="2" maxlength="16" name="">
			</div>


			<div class="login_btn">
				<input type="submit" value="登录" class="login_button" onclick="loginSub()">
				<input type="button" value="重置" class="reset_botton" onclick="reset()">

			</div>
		</div>

		<div class="bottom">
			©1988 DMGJ
			<a target="_blank" href="javascript:;">关于</a>
			<span>东明（国际）家居博览有限公司</span>
			<img width="13" height="16" src="">
		</div>

	</body>
	<script>
		function loginSub() {
			var username = $("#username").val();
			var pwd = $("#pwd").val();
			if(username == "") {
				$.messager.alert("提示","请输入用户名");
				return false;
			} else if(pwd == "") {
                $.messager.alert("提示","请输入密码");
				return false;
			}
			var jsondata = {"username": username,"password": pwd}
			var data_json = JSON.stringify(jsondata);
			
			$.ajax({
				url: "./goLogis/login", //请求的url地址
				xhrFields: {
      				withCredentials: true
   				},
				dataType: "json", //返回格式为json
				data: data_json, //参数值
				type: "POST", //请求方式
				processData: false, //对表单data数据是否进行序列化
				contentType: false, //dataType设置你收到服务器数据的格式
				headers : {
				    'Content-Type' : 'application/json'
				},
				beforeSend: function() {
					//请求前的处理
				},
				success: function(data) {
					if(data.status=="0"){
						$.messager.alert('提示', "无当前用户名");
					}
					if(data.status=="2"){
						$.messager.alert('提示', "密码输入错误");
					}
					if(data.status=="1"){
						window.location.href='index.html';
					}
				},
				complete: function() {
					//请求完成的处理
				},
				error: function() {
					//请求出错处理
				}
			});
			
		}

		function reset() {
            $("#username").val(null);
            $("#pwd").val(null);
        }
	</script>

</html>